package com.ruoyi.common.enums;

public enum WalmartFulfillmentStatus {
    WALMART_FULFILLED(1, "Walmart Fulfilled"),
    WFS_ELIGIBLE(2, "WFS Eligible"),
    SELLER_FULFILLED(3, "Seller Fulfilled");

    private final Integer value;
    private final String name;

    // Constructor to assign values
    WalmartFulfillmentStatus(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    // Getter for value
    public Integer getValue() {
        return value;
    }

    // Getter for name
    public String getName() {
        return name;
    }

    // Optional: Method to get enum by integer value
    public static WalmartFulfillmentStatus fromValue(Integer value) {
        for (WalmartFulfillmentStatus status : WalmartFulfillmentStatus.values()) {
            if (status.getValue().equals(value)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Unexpected value: " + value);
    }

    // Optional: Method to get enum by name (String)
    public static WalmartFulfillmentStatus fromName(String name) {
        for (WalmartFulfillmentStatus status : WalmartFulfillmentStatus.values()) {
            if (status.getName().equals(name)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Unexpected name: " + name);
    }
}
